@include('admin.public.head')
@include('admin.public.pop')

<style type="text/css">
    .inner_btn {
        background: #19a97b;
        color: white;
        padding: 5px 8px;
        border-radius: 2px;
    }
</style>

<div class="ibox-title">
    <h5>订单管理</h5>
</div>

<div class="ibox-content">
    <div class="row">
        <div class="col-sm-12 pull-right m-b-xs">
            <form action="">
                <div class="col-sm-1  m-b-xs text-center pull-right">
                    <button type="submit" class="btn btn-sm btn-primary">搜索</button> </span>
                </div>

                <div class="col-sm-2 text-center pull-right">
                    <input type="text" name="sear_value" value="{{$sear_value}}" placeholder="会员名称/会员电话" class="input form-control">
                </div>

                <div class="col-sm-1 text-center pull-right">
                    <select class="form-control" name="is_receive" >
                        <option value="">领取情况</option>
                        <option value="1" @if($is_receive === '1') selected="selected" @endif>已领取</option>
                        <option value="0" @if($is_receive === '0') selected="selected" @endif>未领取</option>
                    </select>
                </div>

            </form>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>用戶頭像</th>
                <th>用戶姓名</th>
                <th>用户電話</th>
                <th>兌換商品圖片</th>
                <th>兌換積分</th>
                <th>兑换时间</th>
                <th>领取时间</th>
                <th>領取狀態</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        @foreach ($result as $v)
            <tr>
                <td><img src="{{$v->user->head_img}}" width="100" height="100"></td>
                <td>{{$v->user->name}}</td>
                <td>{{$v->user->phone}}</td>
                <td><img src="{{$v->goods->goods_img}}" width="300" height="150"></td>
                <td>{{$v->use_integral}}</td>
                <td>{{$v->created_at}}</td>
                <td>{{$v->updated_at}}</td>
                <td>
                    @if($v->is_receive == 1)已領取@endif
                    @if($v->is_receive == 0)未領取@endif
                </td>
                <td>
                    @if(permission('/order_edit', $user['right_list'], $user['get_routes']))
                    @if($v->is_receive == 0)
                        <div class="btn-group">
                            <a  class="btn btn-primary btn-sm dropdown-toggle" href="javascript:void(0)" url="/order_edit/{{$v->id}}" onclick="do_reservation_edit($(this),'你確定要领取?','领取成功!')">领取
                            </a>&nbsp;&nbsp;
                        </div>
                    @endif
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
        {{ $result->appends(Request::except('page'))->links() }}
    </table>
    {{ $result->appends(Request::except('page'))->links() }}
</div>

